<%Const respagecode="product_search"%><% 'UTF-8%>
<%''加载通用函数和数据库连接%>
<!--#include file="../Include/Start.asp"-->
<%'检查是否登录%>
<!--#include file="../Include/checklogin.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<!--meta信息-->
	<!--#include file="../Include/meta.asp"-->
	
 
 
	<%
		dim filetype,batchcode
						
		filetype=ReplaceBadChar(Trim(request("type")))
		batchcode=ReplaceBadChar(Trim(request("batchcode")))
		''	Response.Write filetype&"-----"
if "xls"=filetype then
 
Response.ContentType   =   "application/vnd.ms-excel"   
  Response.AddHeader   "Content-Disposition",   "attachment;   filename=CardCode_"&batchcode&".xls"  
   
  
  
 

%>

<body>
	
<table border="1">
  <tr>
    <td>卡号</td>
    <td>校验码</td>
    <td>批次</td>
    <td>批号</td>
    <td>出号时间</td>
  </tr>
<%
		''查询结果信息
		Dim rsObj,strSql
		set rsObj=Server.CreateObject("ADODB.Recordset")
		strSql = "SELECT  id, cardcode, yzm, zt, batch, remarks, batchcode, creattime  "
		strSql=strSql & "  FROM KH_XX   WHERE 1=2   "
		If (batchcode <> "") Then  strSql=strSql & " or KH_XX.batchcode = '" & batchcode & "'  "
		strSql=strSql & " ORDER BY cardcode  "	

			'''Response.Write strSql&"-----"


			rsObj.Open strSql, Conn, 1, 3			 
			do while not rsObj.eof
				%>
  <tr>
    <td>&nbsp;<%=Trim(rsObj("cardcode"))%></td>
    <td>&nbsp;<%=Trim(rsObj("yzm"))%></td>
    <td><%=Trim(rsObj("batch"))%></td>
    <td><%=Trim(rsObj("batchcode"))%></td>
    <td><%=Trim(rsObj("creattime"))%></td>
  </tr>
			<%
				rsObj.movenext
			loop 
			''关闭链接
			rsObj.close		
			
	end if
			%>
  
</table>
 
 
</body>
</html>
 <%
	call CloseConn
%>